﻿<Window x:Class="ProjectBilling.UI.RAD.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="250"
        mc:Ignorable="d"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:my="clr-namespace:ProjectBilling.DataAccess;assembly=ProjectBilling.DataAccess"
        Loaded="Window_Loaded">
    <Window.Resources>
        <CollectionViewSource x:Key="projectViewSource"
                d:DesignSource="{d:DesignInstance my:Project, 
                                    CreateList=True}" />
    </Window.Resources>
    <Grid>
        <Grid DataContext="{StaticResource projectViewSource}"
                HorizontalAlignment="Left" Margin="12,12,0,0"
                Name="grid1" VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Content="Name:" Grid.Column="0" Grid.Row="0"
                    HorizontalAlignment="Left" Margin="3"
                    VerticalAlignment="Center" />
            <ComboBox DisplayMemberPath="Name" Grid.Column="1"
                    Grid.Row="0" Height="23"
                    HorizontalAlignment="Left"
                    ItemsSource="{Binding}" Margin="3"
                    Name="nameComboBox"
                    VerticalAlignment="Center" Width="120"
                    SelectionChanged="nameComboBox_SelectionChanged">
                <ComboBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <VirtualizingStackPanel />
                    </ItemsPanelTemplate>
                </ComboBox.ItemsPanel>
            </ComboBox>
        </Grid>
        <Grid DataContext="{StaticResource projectViewSource}"
                HorizontalAlignment="Left" Margin="12,64,0,0"
                Name="grid2" VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Content="Actual:" Grid.Column="0"
                    Grid.Row="0" HorizontalAlignment="Left"
                    Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="1" Grid.Row="0" Height="23"
                    HorizontalAlignment="Left" Margin="3"
                    Name="actualTextBox"
                    Text="{Binding Path=Actual, Mode=TwoWay, 
                            ValidatesOnExceptions=true, 
                            NotifyOnValidationError=true}"
                    VerticalAlignment="Center" Width="120" />
            <Label Content="Estimate:" Grid.Column="0"
                    Grid.Row="1" HorizontalAlignment="Left"
                    Margin="3" VerticalAlignment="Center" />
            <TextBox Grid.Column="1" Grid.Row="1" Height="23"
                    HorizontalAlignment="Left" Margin="3"
                    Name="estimateTextBox"
                    Text="{Binding Path=Estimate, Mode=TwoWay, 
                            ValidatesOnExceptions=true, 
                            NotifyOnValidationError=true}"
                    VerticalAlignment="Center" Width="120" />
            <Label Content="Id:" Grid.Column="0" Grid.Row="2"
                    HorizontalAlignment="Left" Margin="3"
                    VerticalAlignment="Center" />
            <TextBox Grid.Column="1" Grid.Row="2" Height="23"
                    HorizontalAlignment="Left" Margin="3"
                    Name="idTextBox" 
                    Text="{Binding Path=Id, Mode=TwoWay, 
                            ValidatesOnExceptions=true, 
                            NotifyOnValidationError=true}"
                    VerticalAlignment="Center" Width="120" />
            <Label Content="Name:" Grid.Column="0" Grid.Row="3"
                    HorizontalAlignment="Left" Margin="3"
                    VerticalAlignment="Center" />
            <TextBox Grid.Column="1" Grid.Row="3" Height="23"
                    HorizontalAlignment="Left" Margin="3"
                    Name="nameTextBox" 
                     Text="{Binding Path=Name, Mode=TwoWay, 
                            ValidatesOnExceptions=true, 
                            NotifyOnValidationError=true}"
                    VerticalAlignment="Center" Width="120"
                    IsEnabled="False" />
        </Grid>
        <Button Content="Update" Height="23"
                HorizontalAlignment="Left" Margin="12,187,0,0"
                Name="updateButton" VerticalAlignment="Top"
                Width="75" Click="updateButton_Click"
                IsEnabled="False" />
    </Grid>
</Window>
